<?php
namespace statistics;
use statistics\utils\DBAccess;
require_once(substr(__DIR__, 0, strpos(__DIR__, 'statistics')+10). DIRECTORY_SEPARATOR .'includes.php');
echo "plugin state is beeing checked...";
$dbAccess = DBAccess::getInstance();
echo "DBAccess created";
if ($dbAccess->isPluginInstalled()){
	echo "is installed";
	$statisticsEntryPage = 'Location: '.STATISTICS_WEB_ROOT . '/controller/editor/editor.php';
}else{
	$statisticsEntryPage = 'Location: '.STATISTICS_WEB_ROOT . '/view/install.php';
}

header($statisticsEntryPage);
?>